# #循环语句
# num = 1
# while num <= 10:
#     print(num)
#     num+=1

# #计算1~100的和
# num = 1
# sum = 0
# while num <= 100:
#     sum+=num
#     num+=1
# print(sum)

# #计算5的阶乘
# num = 1
# sum = 1
# while num<=5:
#     sum *=num
#     num+=1
# print(sum)

# #计算1! + 2! + 3! + 4!
# num = 1
# sum = 0
# while num<=4:
#     ret = 1
#     cur = 1
#     while ret<=num:
#         cur*=ret
#         ret+=1
#     sum+=cur
#     num+=1
# print(sum)

#range是一个内建函数,起到的效果就得到一个"可迭代对象",包含一系列整数,range[beg,end),前闭后开
#打印1~10
for i in range(1,11):
    print(i)

#提供了第三个参数,步长
#打印2,4,6,8
for i in range(2,10,2):
    print(i)

for i in range(10,0,-1):
    print(i)

# thesum = 0

#continue break